package api

import (
	"github.com/gin-gonic/gin"
	"zg3/day13/api/handler"
	"zg3/day13/pkg"
)

func LoadRouter(r *gin.Engine) {

	api := r.Group("/api")
	{
		user := api.Group("/user")
		{
			user.POST("/login", handler.UserLogin)
			user.POST("/sms", handler.SendSms)
			user.Use(pkg.JWTAuth("2210a"))
			user.POST("/attention", handler.UserAttention)
		}
		dynamic := api.Group("/dynamic")
		{
			dynamic.Use(pkg.JWTAuth("2210a"))
			dynamic.POST("/add", handler.AddDynamic)
			dynamic.POST("/like", handler.DynamicLike)
		}
	}
}
